import { $put_ } from '@js/request'
import { RoleShcema } from '@src/components/schema/role'

// 更新角色权限
export async function updateRoleRequest (r: RoleShcema, rules: string[]): Promise<void> {
  const o: { [k: string]: any } = { ...r }
  const id = o.id as string
  delete o.id
  const res = await $put_(`/api/common/role/${id}`, {
    ...o,
    rules
  })
  return res.data
}
